{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nvar _excluded = [\"id\", \"mode\", \"prefixCls\", \"backfill\", \"fieldNames\", \"inputValue\", \"searchValue\", \"onSearch\", \"autoClearSearchValue\", \"onSelect\", \"onDeselect\", \"dropdownMatchSelectWidth\", \"filterOption\", \"filterSort\", \"optionFilterProp\", \"optionLabelProp\", \"options\", \"children\", \"defaultActiveFirstOption\", \"menuItemSelectedIcon\", \"virtual\", \"listHeight\", \"listItemHeight\", \"value\", \"defaultValue\", \"labelInValue\", \"onChange\"];\n\n/**\n * To match accessibility requirement, we always provide an input in the component.\n * Other element will not set `tabIndex` to avoid `onBlur` sequence problem.\n * For focused select, we set `aria-live=\"polite\"` to update the accessibility content.\n *\n * ref:\n * - keyboard: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/listbox_role#Keyboard_interactions\n *\n * New api:\n * - listHeight\n * - listItemHeight\n * - component\n *\n * Remove deprecated api:\n * - multiple\n * - tags\n * - combobox\n * - firstActiveValue\n * - dropdownMenuStyle\n * - openClassName (Not list in api)\n *\n * Update:\n * - `backfill` only support `combobox` mode\n * - `combobox` mode not support `labelInValue` since it's meaningless\n * - `getInputElement` only support `combobox` mode\n * - `onChange` return OptionData instead of ReactNode\n * - `filterOption` `onChange` `onSelect` accept OptionData instead of ReactNode\n * - `combobox` mode trigger `onChange` will get `undefined` if no `value` match in Option\n * - `combobox` mode not support `optionLabelProp`\n */\nimport useMergedState from \"rc-util/es/hooks/useMergedState\";\nimport warning from \"rc-util/es/warning\";\nimport * as React from 'react';\nimport BaseSelect, { isMultiple } from \"./BaseSelect\";\nimport useCache from \"./hooks/useCache\";\nimport useFilterOptions from \"./hooks/useFilterOptions\";\nimport useId from \"./hooks/useId\";\nimport useOptions from \"./hooks/useOptions\";\nimport useRefFunc from \"./hooks/useRefFunc\";\nimport OptGroup from \"./OptGroup\";\nimport Option from \"./Option\";\nimport OptionList from \"./OptionList\";\nimport SelectContext from \"./SelectContext\";\nimport { hasValue, toArray } from \"./utils/commonUtil\";\nimport { fillFieldNames, flattenOptions, injectPropsWithOption } from \"./utils/valueUtil\";\nimport warningProps, { warningNullOptions } from \"./utils/warningPropsUtil\";\nvar OMIT_DOM_PROPS = ['inputValue'];\nfunction isRawValue(value) {\n  return !value || _typeof(value) !== 'object';\n}\nvar Select = /*#__PURE__*/React.forwardRef(function (props, ref) {\n  var id = props.id,\n    mode = props.mode,\n    _props$prefixCls = props.prefixCls,\n    prefixCls = _props$prefixCls === void 0 ? 'rc-select' : _props$prefixCls,\n    backfill = props.backfill,\n    fieldNames = props.fieldNames,\n    inputValue = props.inputValue,\n    searchValue = props.searchValue,\n    onSearch = props.onSearch,\n    _props$autoClearSearc = props.autoClearSearchValue,\n    autoClearSearchValue = _props$autoClearSearc === void 0 ? true : _props$autoClearSearc,\n    onSelect = props.onSelect,\n    onDeselect = props.onDeselect,\n    _props$dropdownMatchS = props.dropdownMatchSelectWidth,\n    dropdownMatchSelectWidth = _props$dropdownMatchS === void 0 ? true : _props$dropdownMatchS,\n    filterOption = props.filterOption,\n    filterSort = props.filterSort,\n    optionFilterProp = props.optionFilterProp,\n    optionLabelProp = props.optionLabelProp,\n    options = props.options,\n    children = props.children,\n    defaultActiveFirstOption = props.defaultActiveFirstOption,\n    menuItemSelectedIcon = props.menuItemSelectedIcon,\n    virtual = props.virtual,\n    _props$listHeight = props.listHeight,\n    listHeight = _props$listHeight === void 0 ? 200 : _props$listHeight,\n    _props$listItemHeight = props.listItemHeight,\n    listItemHeight = _props$listItemHeight === void 0 ? 20 : _props$listItemHeight,\n    value = props.value,\n    defaultValue = props.defaultValue,\n    labelInValue = props.labelInValue,\n    onChange = props.onChange,\n    restProps = _objectWithoutProperties(props, _excluded);\n  var mergedId = useId(id);\n  var multiple = isMultiple(mode);\n  var childrenAsData = !!(!options && children);\n  var mergedFilterOption = React.useMemo(function () {\n    if (filterOption === undefined && mode === 'combobox') {\n      return false;\n    }\n    return filterOption;\n  }, [filterOption, mode]); // ========================= FieldNames =========================\n\n  var mergedFieldNames = React.useMemo(function () {\n    return fillFieldNames(fieldNames, childrenAsData);\n  }, /* eslint-disable react-hooks/exhaustive-deps */\n  [\n  // We stringify fieldNames to avoid unnecessary re-renders.\n  JSON.stringify(fieldNames), childrenAsData]\n  /* eslint-enable react-hooks/exhaustive-deps */); // =========================== Search ===========================\n\n  var _useMergedState = useMergedState('', {\n      value: searchValue !== undefined ? searchValue : inputValue,\n      postState: function postState(search) {\n        return search || '';\n      }\n    }),\n    _useMergedState2 = _slicedToArray(_useMergedState, 2),\n    mergedSearchValue = _useMergedState2[0],\n    setSearchValue = _useMergedState2[1]; // =========================== Option ===========================\n\n  var parsedOptions = useOptions(options, children, mergedFieldNames, optionFilterProp, optionLabelProp);\n  var valueOptions = parsedOptions.valueOptions,\n    labelOptions = parsedOptions.labelOptions,\n    mergedOptions = parsedOptions.options; // ========================= Wrap Value =========================\n\n  var convert2LabelValues = React.useCallback(function (draftValues) {\n    // Convert to array\n    var valueList = toArray(draftValues); // Convert to labelInValue type\n\n    return valueList.map(function (val) {\n      var rawValue;\n      var rawLabel;\n      var rawKey;\n      var rawDisabled;\n      var rawTitle; // Fill label & value\n\n      if (isRawValue(val)) {\n        rawValue = val;\n      } else {\n        var _val$value;\n        rawKey = val.key;\n        rawLabel = val.label;\n        rawValue = (_val$value = val.value) !== null && _val$value !== void 0 ? _val$value : rawKey;\n      }\n      var option = valueOptions.get(rawValue);\n      if (option) {\n        var _option$key;\n\n        // Fill missing props\n        if (rawLabel === undefined) rawLabel = option === null || option === void 0 ? void 0 : option[optionLabelProp || mergedFieldNames.label];\n        if (rawKey === undefined) rawKey = (_option$key = option === null || option === void 0 ? void 0 : option.key) !== null && _option$key !== void 0 ? _option$key : rawValue;\n        rawDisabled = option === null || option === void 0 ? void 0 : option.disabled;\n        rawTitle = option === null || option === void 0 ? void 0 : option.title; // Warning if label not same as provided\n\n        if (process.env.NODE_ENV !== 'production' && !optionLabelProp) {\n          var optionLabel = option === null || option === void 0 ? void 0 : option[mergedFieldNames.label];\n          if (optionLabel !== undefined && optionLabel !== rawLabel) {\n            warning(false, '`label` of `value` is not same as `label` in Select options.');\n          }\n        }\n      }\n      return {\n        label: rawLabel,\n        value: rawValue,\n        key: rawKey,\n        disabled: rawDisabled,\n        title: rawTitle\n      };\n    });\n  }, [mergedFieldNames, optionLabelProp, valueOptions]); // =========================== Values ===========================\n\n  var _useMergedState3 = useMergedState(defaultValue, {\n      value: value\n    }),\n    _useMergedState4 = _slicedToArray(_useMergedState3, 2),\n    internalValue = _useMergedState4[0],\n    setInternalValue = _useMergedState4[1]; // Merged value with LabelValueType\n\n  var rawLabeledValues = React.useMemo(function () {\n    var _values$;\n    var values = convert2LabelValues(internalValue); // combobox no need save value when it's no value\n\n    if (mode === 'combobox' && !((_values$ = values[0]) !== null && _values$ !== void 0 && _values$.value)) {\n      return [];\n    }\n    return values;\n  }, [internalValue, convert2LabelValues, mode]); // Fill label with cache to avoid option remove\n\n  var _useCache = useCache(rawLabeledValues, valueOptions),\n    _useCache2 = _slicedToArray(_useCache, 2),\n    mergedValues = _useCache2[0],\n    getMixedOption = _useCache2[1];\n  var displayValues = React.useMemo(function () {\n    // `null` need show as placeholder instead\n    // https://github.com/ant-design/ant-design/issues/25057\n    if (!mode && mergedValues.length === 1) {\n      var firstValue = mergedValues[0];\n      if (firstValue.value === null && (firstValue.label === null || firstValue.label === undefined)) {\n        return [];\n      }\n    }\n    return mergedValues.map(function (item) {\n      var _item$label;\n      return _objectSpread(_objectSpread({}, item), {}, {\n        label: (_item$label = item.label) !== null && _item$label !== void 0 ? _item$label : item.value\n      });\n    });\n  }, [mode, mergedValues]);\n  /** Convert `displayValues` to raw value type set */\n\n  var rawValues = React.useMemo(function () {\n    return new Set(mergedValues.map(function (val) {\n      return val.value;\n    }));\n  }, [mergedValues]);\n  React.useEffect(function () {\n    if (mode === 'combobox') {\n      var _mergedValues$;\n      var strValue = (_mergedValues$ = mergedValues[0]) === null || _mergedValues$ === void 0 ? void 0 : _mergedValues$.value;\n      setSearchValue(hasValue(strValue) ? String(strValue) : '');\n    }\n  }, [mergedValues]); // ======================= Display Option =======================\n  // Create a placeholder item if not exist in `options`\n\n  var createTagOption = useRefFunc(function (val, label) {\n    var _ref;\n    var mergedLabel = label !== null && label !== void 0 ? label : val;\n    return _ref = {}, _defineProperty(_ref, mergedFieldNames.value, val), _defineProperty(_ref, mergedFieldNames.label, mergedLabel), _ref;\n  }); // Fill tag as option if mode is `tags`\n\n  var filledTagOptions = React.useMemo(function () {\n    if (mode !== 'tags') {\n      return mergedOptions;\n    } // >>> Tag mode\n\n    var cloneOptions = _toConsumableArray(mergedOptions); // Check if value exist in options (include new patch item)\n\n    var existOptions = function existOptions(val) {\n      return valueOptions.has(val);\n    }; // Fill current value as option\n\n    _toConsumableArray(mergedValues).sort(function (a, b) {\n      return a.value < b.value ? -1 : 1;\n    }).forEach(function (item) {\n      var val = item.value;\n      if (!existOptions(val)) {\n        cloneOptions.push(createTagOption(val, item.label));\n      }\n    });\n    return cloneOptions;\n  }, [createTagOption, mergedOptions, valueOptions, mergedValues, mode]);\n  var filteredOptions = useFilterOptions(filledTagOptions, mergedFieldNames, mergedSearchValue, mergedFilterOption, optionFilterProp); // Fill options with search value if needed\n\n  var filledSearchOptions = React.useMemo(function () {\n    if (mode !== 'tags' || !mergedSearchValue || filteredOptions.some(function (item) {\n      return item[optionFilterProp || 'value'] === mergedSearchValue;\n    })) {\n      return filteredOptions;\n    } // Fill search value as option\n\n    return [createTagOption(mergedSearchValue)].concat(_toConsumableArray(filteredOptions));\n  }, [createTagOption, optionFilterProp, mode, filteredOptions, mergedSearchValue]);\n  var orderedFilteredOptions = React.useMemo(function () {\n    if (!filterSort) {\n      return filledSearchOptions;\n    }\n    return _toConsumableArray(filledSearchOptions).sort(function (a, b) {\n      return filterSort(a, b);\n    });\n  }, [filledSearchOptions, filterSort]);\n  var displayOptions = React.useMemo(function () {\n    return flattenOptions(orderedFilteredOptions, {\n      fieldNames: mergedFieldNames,\n      childrenAsData: childrenAsData\n    });\n  }, [orderedFilteredOptions, mergedFieldNames, childrenAsData]); // =========================== Change ===========================\n\n  var triggerChange = function triggerChange(values) {\n    var labeledValues = convert2LabelValues(values);\n    setInternalValue(labeledValues);\n    if (onChange && (\n    // Trigger event only when value changed\n    labeledValues.length !== mergedValues.length || labeledValues.some(function (newVal, index) {\n      var _mergedValues$index;\n      return ((_mergedValues$index = mergedValues[index]) === null || _mergedValues$index === void 0 ? void 0 : _mergedValues$index.value) !== (newVal === null || newVal === void 0 ? void 0 : newVal.value);\n    }))) {\n      var returnValues = labelInValue ? labeledValues : labeledValues.map(function (v) {\n        return v.value;\n      });\n      var returnOptions = labeledValues.map(function (v) {\n        return injectPropsWithOption(getMixedOption(v.value));\n      });\n      onChange(\n      // Value\n      multiple ? returnValues : returnValues[0],\n      // Option\n      multiple ? returnOptions : returnOptions[0]);\n    }\n  }; // ======================= Accessibility ========================\n\n  var _React$useState = React.useState(null),\n    _React$useState2 = _slicedToArray(_React$useState, 2),\n    activeValue = _React$useState2[0],\n    setActiveValue = _React$useState2[1];\n  var _React$useState3 = React.useState(0),\n    _React$useState4 = _slicedToArray(_React$useState3, 2),\n    accessibilityIndex = _React$useState4[0],\n    setAccessibilityIndex = _React$useState4[1];\n  var mergedDefaultActiveFirstOption = defaultActiveFirstOption !== undefined ? defaultActiveFirstOption : mode !== 'combobox';\n  var onActiveValue = React.useCallback(function (active, index) {\n    var _ref2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},\n      _ref2$source = _ref2.source,\n      source = _ref2$source === void 0 ? 'keyboard' : _ref2$source;\n    setAccessibilityIndex(index);\n    if (backfill && mode === 'combobox' && active !== null && source === 'keyboard') {\n      setActiveValue(String(active));\n    }\n  }, [backfill, mode]); // ========================= OptionList =========================\n\n  var triggerSelect = function triggerSelect(val, selected, type) {\n    var getSelectEnt = function getSelectEnt() {\n      var _option$key2;\n      var option = getMixedOption(val);\n      return [labelInValue ? {\n        label: option === null || option === void 0 ? void 0 : option[mergedFieldNames.label],\n        value: val,\n        key: (_option$key2 = option === null || option === void 0 ? void 0 : option.key) !== null && _option$key2 !== void 0 ? _option$key2 : val\n      } : val, injectPropsWithOption(option)];\n    };\n    if (selected && onSelect) {\n      var _getSelectEnt = getSelectEnt(),\n        _getSelectEnt2 = _slicedToArray(_getSelectEnt, 2),\n        wrappedValue = _getSelectEnt2[0],\n        _option = _getSelectEnt2[1];\n      onSelect(wrappedValue, _option);\n    } else if (!selected && onDeselect && type !== 'clear') {\n      var _getSelectEnt3 = getSelectEnt(),\n        _getSelectEnt4 = _slicedToArray(_getSelectEnt3, 2),\n        _wrappedValue = _getSelectEnt4[0],\n        _option2 = _getSelectEnt4[1];\n      onDeselect(_wrappedValue, _option2);\n    }\n  }; // Used for OptionList selection\n\n  var onInternalSelect = useRefFunc(function (val, info) {\n    var cloneValues; // Single mode always trigger select only with option list\n\n    var mergedSelect = multiple ? info.selected : true;\n    if (mergedSelect) {\n      cloneValues = multiple ? [].concat(_toConsumableArray(mergedValues), [val]) : [val];\n    } else {\n      cloneValues = mergedValues.filter(function (v) {\n        return v.value !== val;\n      });\n    }\n    triggerChange(cloneValues);\n    triggerSelect(val, mergedSelect); // Clean search value if single or configured\n\n    if (mode === 'combobox') {\n      // setSearchValue(String(val));\n      setActiveValue('');\n    } else if (!isMultiple || autoClearSearchValue) {\n      setSearchValue('');\n      setActiveValue('');\n    }\n  }); // ======================= Display Change =======================\n  // BaseSelect display values change\n\n  var onDisplayValuesChange = function onDisplayValuesChange(nextValues, info) {\n    triggerChange(nextValues);\n    var type = info.type,\n      values = info.values;\n    if (type === 'remove' || type === 'clear') {\n      values.forEach(function (item) {\n        triggerSelect(item.value, false, type);\n      });\n    }\n  }; // =========================== Search ===========================\n\n  var onInternalSearch = function onInternalSearch(searchText, info) {\n    setSearchValue(searchText);\n    setActiveValue(null); // [Submit] Tag mode should flush input\n\n    if (info.source === 'submit') {\n      var formatted = (searchText || '').trim(); // prevent empty tags from appearing when you click the Enter button\n\n      if (formatted) {\n        var newRawValues = Array.from(new Set([].concat(_toConsumableArray(rawValues), [formatted])));\n        triggerChange(newRawValues);\n        triggerSelect(formatted, true);\n        setSearchValue('');\n      }\n      return;\n    }\n    if (info.source !== 'blur') {\n      if (mode === 'combobox') {\n        triggerChange(searchText);\n      }\n      onSearch === null || onSearch === void 0 ? void 0 : onSearch(searchText);\n    }\n  };\n  var onInternalSearchSplit = function onInternalSearchSplit(words) {\n    var patchValues = words;\n    if (mode !== 'tags') {\n      patchValues = words.map(function (word) {\n        var opt = labelOptions.get(word);\n        return opt === null || opt === void 0 ? void 0 : opt.value;\n      }).filter(function (val) {\n        return val !== undefined;\n      });\n    }\n    var newRawValues = Array.from(new Set([].concat(_toConsumableArray(rawValues), _toConsumableArray(patchValues))));\n    triggerChange(newRawValues);\n    newRawValues.forEach(function (newRawValue) {\n      triggerSelect(newRawValue, true);\n    });\n  }; // ========================== Context ===========================\n\n  var selectContext = React.useMemo(function () {\n    var realVirtual = virtual !== false && dropdownMatchSelectWidth !== false;\n    return _objectSpread(_objectSpread({}, parsedOptions), {}, {\n      flattenOptions: displayOptions,\n      onActiveValue: onActiveValue,\n      defaultActiveFirstOption: mergedDefaultActiveFirstOption,\n      onSelect: onInternalSelect,\n      menuItemSelectedIcon: menuItemSelectedIcon,\n      rawValues: rawValues,\n      fieldNames: mergedFieldNames,\n      virtual: realVirtual,\n      listHeight: listHeight,\n      listItemHeight: listItemHeight,\n      childrenAsData: childrenAsData\n    });\n  }, [parsedOptions, displayOptions, onActiveValue, mergedDefaultActiveFirstOption, onInternalSelect, menuItemSelectedIcon, rawValues, mergedFieldNames, virtual, dropdownMatchSelectWidth, listHeight, listItemHeight, childrenAsData]); // ========================== Warning ===========================\n\n  if (process.env.NODE_ENV !== 'production') {\n    warningProps(props);\n    warningNullOptions(mergedOptions, mergedFieldNames);\n  } // ==============================================================\n  // ==                          Render                          ==\n  // ==============================================================\n\n  return /*#__PURE__*/React.createElement(SelectContext.Provider, {\n    value: selectContext\n  }, /*#__PURE__*/React.createElement(BaseSelect, _extends({}, restProps, {\n    // >>> MISC\n    id: mergedId,\n    prefixCls: prefixCls,\n    ref: ref,\n    omitDomProps: OMIT_DOM_PROPS,\n    mode: mode // >>> Values\n    ,\n\n    displayValues: displayValues,\n    onDisplayValuesChange: onDisplayValuesChange // >>> Search\n    ,\n\n    searchValue: mergedSearchValue,\n    onSearch: onInternalSearch,\n    autoClearSearchValue: autoClearSearchValue,\n    onSearchSplit: onInternalSearchSplit,\n    dropdownMatchSelectWidth: dropdownMatchSelectWidth // >>> OptionList\n    ,\n\n    OptionList: OptionList,\n    emptyOptions: !displayOptions.length // >>> Accessibility\n    ,\n\n    activeValue: activeValue,\n    activeDescendantId: \"\".concat(mergedId, \"_list_\").concat(accessibilityIndex)\n  })));\n});\nif (process.env.NODE_ENV !== 'production') {\n  Select.displayName = 'Select';\n}\nvar TypedSelect = Select;\nTypedSelect.Option = Option;\nTypedSelect.OptGroup = OptGroup;\nexport default TypedSelect;","map":{"version":3,"names":["_extends","_toConsumableArray","_defineProperty","_objectSpread","_slicedToArray","_objectWithoutProperties","_typeof","_excluded","useMergedState","warning","React","BaseSelect","isMultiple","useCache","useFilterOptions","useId","useOptions","useRefFunc","OptGroup","Option","OptionList","SelectContext","hasValue","toArray","fillFieldNames","flattenOptions","injectPropsWithOption","warningProps","warningNullOptions","OMIT_DOM_PROPS","isRawValue","value","Select","forwardRef","props","ref","id","mode","_props$prefixCls","prefixCls","backfill","fieldNames","inputValue","searchValue","onSearch","_props$autoClearSearc","autoClearSearchValue","onSelect","onDeselect","_props$dropdownMatchS","dropdownMatchSelectWidth","filterOption","filterSort","optionFilterProp","optionLabelProp","options","children","defaultActiveFirstOption","menuItemSelectedIcon","virtual","_props$listHeight","listHeight","_props$listItemHeight","listItemHeight","defaultValue","labelInValue","onChange","restProps","mergedId","multiple","childrenAsData","mergedFilterOption","useMemo","undefined","mergedFieldNames","JSON","stringify","_useMergedState","postState","search","_useMergedState2","mergedSearchValue","setSearchValue","parsedOptions","valueOptions","labelOptions","mergedOptions","convert2LabelValues","useCallback","draftValues","valueList","map","val","rawValue","rawLabel","rawKey","rawDisabled","rawTitle","_val$value","key","label","option","get","_option$key","disabled","title","process","env","NODE_ENV","optionLabel","_useMergedState3","_useMergedState4","internalValue","setInternalValue","rawLabeledValues","_values$","values","_useCache","_useCache2","mergedValues","getMixedOption","displayValues","length","firstValue","item","_item$label","rawValues","Set","useEffect","_mergedValues$","strValue","String","createTagOption","_ref","mergedLabel","filledTagOptions","cloneOptions","existOptions","has","sort","a","b","forEach","push","filteredOptions","filledSearchOptions","some","concat","orderedFilteredOptions","displayOptions","triggerChange","labeledValues","newVal","index","_mergedValues$index","returnValues","v","returnOptions","_React$useState","useState","_React$useState2","activeValue","setActiveValue","_React$useState3","_React$useState4","accessibilityIndex","setAccessibilityIndex","mergedDefaultActiveFirstOption","onActiveValue","active","_ref2","arguments","_ref2$source","source","triggerSelect","selected","type","getSelectEnt","_option$key2","_getSelectEnt","_getSelectEnt2","wrappedValue","_option","_getSelectEnt3","_getSelectEnt4","_wrappedValue","_option2","onInternalSelect","info","cloneValues","mergedSelect","filter","onDisplayValuesChange","nextValues","onInternalSearch","searchText","formatted","trim","newRawValues","Array","from","onInternalSearchSplit","words","patchValues","word","opt","newRawValue","selectContext","realVirtual","createElement","Provider","omitDomProps","onSearchSplit","emptyOptions","activeDescendantId","displayName","TypedSelect"],"sources":["/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/rc-select/es/Select.js"],"sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nvar _excluded = [\"id\", \"mode\", \"prefixCls\", \"backfill\", \"fieldNames\", \"inputValue\", \"searchValue\", \"onSearch\", \"autoClearSearchValue\", \"onSelect\", \"onDeselect\", \"dropdownMatchSelectWidth\", \"filterOption\", \"filterSort\", \"optionFilterProp\", \"optionLabelProp\", \"options\", \"children\", \"defaultActiveFirstOption\", \"menuItemSelectedIcon\", \"virtual\", \"listHeight\", \"listItemHeight\", \"value\", \"defaultValue\", \"labelInValue\", \"onChange\"];\n\n/**\n * To match accessibility requirement, we always provide an input in the component.\n * Other element will not set `tabIndex` to avoid `onBlur` sequence problem.\n * For focused select, we set `aria-live=\"polite\"` to update the accessibility content.\n *\n * ref:\n * - keyboard: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/listbox_role#Keyboard_interactions\n *\n * New api:\n * - listHeight\n * - listItemHeight\n * - component\n *\n * Remove deprecated api:\n * - multiple\n * - tags\n * - combobox\n * - firstActiveValue\n * - dropdownMenuStyle\n * - openClassName (Not list in api)\n *\n * Update:\n * - `backfill` only support `combobox` mode\n * - `combobox` mode not support `labelInValue` since it's meaningless\n * - `getInputElement` only support `combobox` mode\n * - `onChange` return OptionData instead of ReactNode\n * - `filterOption` `onChange` `onSelect` accept OptionData instead of ReactNode\n * - `combobox` mode trigger `onChange` will get `undefined` if no `value` match in Option\n * - `combobox` mode not support `optionLabelProp`\n */\nimport useMergedState from \"rc-util/es/hooks/useMergedState\";\nimport warning from \"rc-util/es/warning\";\nimport * as React from 'react';\nimport BaseSelect, { isMultiple } from \"./BaseSelect\";\nimport useCache from \"./hooks/useCache\";\nimport useFilterOptions from \"./hooks/useFilterOptions\";\nimport useId from \"./hooks/useId\";\nimport useOptions from \"./hooks/useOptions\";\nimport useRefFunc from \"./hooks/useRefFunc\";\nimport OptGroup from \"./OptGroup\";\nimport Option from \"./Option\";\nimport OptionList from \"./OptionList\";\nimport SelectContext from \"./SelectContext\";\nimport { hasValue, toArray } from \"./utils/commonUtil\";\nimport { fillFieldNames, flattenOptions, injectPropsWithOption } from \"./utils/valueUtil\";\nimport warningProps, { warningNullOptions } from \"./utils/warningPropsUtil\";\nvar OMIT_DOM_PROPS = ['inputValue'];\n\nfunction isRawValue(value) {\n  return !value || _typeof(value) !== 'object';\n}\n\nvar Select = /*#__PURE__*/React.forwardRef(function (props, ref) {\n  var id = props.id,\n      mode = props.mode,\n      _props$prefixCls = props.prefixCls,\n      prefixCls = _props$prefixCls === void 0 ? 'rc-select' : _props$prefixCls,\n      backfill = props.backfill,\n      fieldNames = props.fieldNames,\n      inputValue = props.inputValue,\n      searchValue = props.searchValue,\n      onSearch = props.onSearch,\n      _props$autoClearSearc = props.autoClearSearchValue,\n      autoClearSearchValue = _props$autoClearSearc === void 0 ? true : _props$autoClearSearc,\n      onSelect = props.onSelect,\n      onDeselect = props.onDeselect,\n      _props$dropdownMatchS = props.dropdownMatchSelectWidth,\n      dropdownMatchSelectWidth = _props$dropdownMatchS === void 0 ? true : _props$dropdownMatchS,\n      filterOption = props.filterOption,\n      filterSort = props.filterSort,\n      optionFilterProp = props.optionFilterProp,\n      optionLabelProp = props.optionLabelProp,\n      options = props.options,\n      children = props.children,\n      defaultActiveFirstOption = props.defaultActiveFirstOption,\n      menuItemSelectedIcon = props.menuItemSelectedIcon,\n      virtual = props.virtual,\n      _props$listHeight = props.listHeight,\n      listHeight = _props$listHeight === void 0 ? 200 : _props$listHeight,\n      _props$listItemHeight = props.listItemHeight,\n      listItemHeight = _props$listItemHeight === void 0 ? 20 : _props$listItemHeight,\n      value = props.value,\n      defaultValue = props.defaultValue,\n      labelInValue = props.labelInValue,\n      onChange = props.onChange,\n      restProps = _objectWithoutProperties(props, _excluded);\n\n  var mergedId = useId(id);\n  var multiple = isMultiple(mode);\n  var childrenAsData = !!(!options && children);\n  var mergedFilterOption = React.useMemo(function () {\n    if (filterOption === undefined && mode === 'combobox') {\n      return false;\n    }\n\n    return filterOption;\n  }, [filterOption, mode]); // ========================= FieldNames =========================\n\n  var mergedFieldNames = React.useMemo(function () {\n    return fillFieldNames(fieldNames, childrenAsData);\n  },\n  /* eslint-disable react-hooks/exhaustive-deps */\n  [// We stringify fieldNames to avoid unnecessary re-renders.\n  JSON.stringify(fieldNames), childrenAsData]\n  /* eslint-enable react-hooks/exhaustive-deps */\n  ); // =========================== Search ===========================\n\n  var _useMergedState = useMergedState('', {\n    value: searchValue !== undefined ? searchValue : inputValue,\n    postState: function postState(search) {\n      return search || '';\n    }\n  }),\n      _useMergedState2 = _slicedToArray(_useMergedState, 2),\n      mergedSearchValue = _useMergedState2[0],\n      setSearchValue = _useMergedState2[1]; // =========================== Option ===========================\n\n\n  var parsedOptions = useOptions(options, children, mergedFieldNames, optionFilterProp, optionLabelProp);\n  var valueOptions = parsedOptions.valueOptions,\n      labelOptions = parsedOptions.labelOptions,\n      mergedOptions = parsedOptions.options; // ========================= Wrap Value =========================\n\n  var convert2LabelValues = React.useCallback(function (draftValues) {\n    // Convert to array\n    var valueList = toArray(draftValues); // Convert to labelInValue type\n\n    return valueList.map(function (val) {\n      var rawValue;\n      var rawLabel;\n      var rawKey;\n      var rawDisabled;\n      var rawTitle; // Fill label & value\n\n      if (isRawValue(val)) {\n        rawValue = val;\n      } else {\n        var _val$value;\n\n        rawKey = val.key;\n        rawLabel = val.label;\n        rawValue = (_val$value = val.value) !== null && _val$value !== void 0 ? _val$value : rawKey;\n      }\n\n      var option = valueOptions.get(rawValue);\n\n      if (option) {\n        var _option$key;\n\n        // Fill missing props\n        if (rawLabel === undefined) rawLabel = option === null || option === void 0 ? void 0 : option[optionLabelProp || mergedFieldNames.label];\n        if (rawKey === undefined) rawKey = (_option$key = option === null || option === void 0 ? void 0 : option.key) !== null && _option$key !== void 0 ? _option$key : rawValue;\n        rawDisabled = option === null || option === void 0 ? void 0 : option.disabled;\n        rawTitle = option === null || option === void 0 ? void 0 : option.title; // Warning if label not same as provided\n\n        if (process.env.NODE_ENV !== 'production' && !optionLabelProp) {\n          var optionLabel = option === null || option === void 0 ? void 0 : option[mergedFieldNames.label];\n\n          if (optionLabel !== undefined && optionLabel !== rawLabel) {\n            warning(false, '`label` of `value` is not same as `label` in Select options.');\n          }\n        }\n      }\n\n      return {\n        label: rawLabel,\n        value: rawValue,\n        key: rawKey,\n        disabled: rawDisabled,\n        title: rawTitle\n      };\n    });\n  }, [mergedFieldNames, optionLabelProp, valueOptions]); // =========================== Values ===========================\n\n  var _useMergedState3 = useMergedState(defaultValue, {\n    value: value\n  }),\n      _useMergedState4 = _slicedToArray(_useMergedState3, 2),\n      internalValue = _useMergedState4[0],\n      setInternalValue = _useMergedState4[1]; // Merged value with LabelValueType\n\n\n  var rawLabeledValues = React.useMemo(function () {\n    var _values$;\n\n    var values = convert2LabelValues(internalValue); // combobox no need save value when it's no value\n\n    if (mode === 'combobox' && !((_values$ = values[0]) !== null && _values$ !== void 0 && _values$.value)) {\n      return [];\n    }\n\n    return values;\n  }, [internalValue, convert2LabelValues, mode]); // Fill label with cache to avoid option remove\n\n  var _useCache = useCache(rawLabeledValues, valueOptions),\n      _useCache2 = _slicedToArray(_useCache, 2),\n      mergedValues = _useCache2[0],\n      getMixedOption = _useCache2[1];\n\n  var displayValues = React.useMemo(function () {\n    // `null` need show as placeholder instead\n    // https://github.com/ant-design/ant-design/issues/25057\n    if (!mode && mergedValues.length === 1) {\n      var firstValue = mergedValues[0];\n\n      if (firstValue.value === null && (firstValue.label === null || firstValue.label === undefined)) {\n        return [];\n      }\n    }\n\n    return mergedValues.map(function (item) {\n      var _item$label;\n\n      return _objectSpread(_objectSpread({}, item), {}, {\n        label: (_item$label = item.label) !== null && _item$label !== void 0 ? _item$label : item.value\n      });\n    });\n  }, [mode, mergedValues]);\n  /** Convert `displayValues` to raw value type set */\n\n  var rawValues = React.useMemo(function () {\n    return new Set(mergedValues.map(function (val) {\n      return val.value;\n    }));\n  }, [mergedValues]);\n  React.useEffect(function () {\n    if (mode === 'combobox') {\n      var _mergedValues$;\n\n      var strValue = (_mergedValues$ = mergedValues[0]) === null || _mergedValues$ === void 0 ? void 0 : _mergedValues$.value;\n      setSearchValue(hasValue(strValue) ? String(strValue) : '');\n    }\n  }, [mergedValues]); // ======================= Display Option =======================\n  // Create a placeholder item if not exist in `options`\n\n  var createTagOption = useRefFunc(function (val, label) {\n    var _ref;\n\n    var mergedLabel = label !== null && label !== void 0 ? label : val;\n    return _ref = {}, _defineProperty(_ref, mergedFieldNames.value, val), _defineProperty(_ref, mergedFieldNames.label, mergedLabel), _ref;\n  }); // Fill tag as option if mode is `tags`\n\n  var filledTagOptions = React.useMemo(function () {\n    if (mode !== 'tags') {\n      return mergedOptions;\n    } // >>> Tag mode\n\n\n    var cloneOptions = _toConsumableArray(mergedOptions); // Check if value exist in options (include new patch item)\n\n\n    var existOptions = function existOptions(val) {\n      return valueOptions.has(val);\n    }; // Fill current value as option\n\n\n    _toConsumableArray(mergedValues).sort(function (a, b) {\n      return a.value < b.value ? -1 : 1;\n    }).forEach(function (item) {\n      var val = item.value;\n\n      if (!existOptions(val)) {\n        cloneOptions.push(createTagOption(val, item.label));\n      }\n    });\n\n    return cloneOptions;\n  }, [createTagOption, mergedOptions, valueOptions, mergedValues, mode]);\n  var filteredOptions = useFilterOptions(filledTagOptions, mergedFieldNames, mergedSearchValue, mergedFilterOption, optionFilterProp); // Fill options with search value if needed\n\n  var filledSearchOptions = React.useMemo(function () {\n    if (mode !== 'tags' || !mergedSearchValue || filteredOptions.some(function (item) {\n      return item[optionFilterProp || 'value'] === mergedSearchValue;\n    })) {\n      return filteredOptions;\n    } // Fill search value as option\n\n\n    return [createTagOption(mergedSearchValue)].concat(_toConsumableArray(filteredOptions));\n  }, [createTagOption, optionFilterProp, mode, filteredOptions, mergedSearchValue]);\n  var orderedFilteredOptions = React.useMemo(function () {\n    if (!filterSort) {\n      return filledSearchOptions;\n    }\n\n    return _toConsumableArray(filledSearchOptions).sort(function (a, b) {\n      return filterSort(a, b);\n    });\n  }, [filledSearchOptions, filterSort]);\n  var displayOptions = React.useMemo(function () {\n    return flattenOptions(orderedFilteredOptions, {\n      fieldNames: mergedFieldNames,\n      childrenAsData: childrenAsData\n    });\n  }, [orderedFilteredOptions, mergedFieldNames, childrenAsData]); // =========================== Change ===========================\n\n  var triggerChange = function triggerChange(values) {\n    var labeledValues = convert2LabelValues(values);\n    setInternalValue(labeledValues);\n\n    if (onChange && ( // Trigger event only when value changed\n    labeledValues.length !== mergedValues.length || labeledValues.some(function (newVal, index) {\n      var _mergedValues$index;\n\n      return ((_mergedValues$index = mergedValues[index]) === null || _mergedValues$index === void 0 ? void 0 : _mergedValues$index.value) !== (newVal === null || newVal === void 0 ? void 0 : newVal.value);\n    }))) {\n      var returnValues = labelInValue ? labeledValues : labeledValues.map(function (v) {\n        return v.value;\n      });\n      var returnOptions = labeledValues.map(function (v) {\n        return injectPropsWithOption(getMixedOption(v.value));\n      });\n      onChange( // Value\n      multiple ? returnValues : returnValues[0], // Option\n      multiple ? returnOptions : returnOptions[0]);\n    }\n  }; // ======================= Accessibility ========================\n\n\n  var _React$useState = React.useState(null),\n      _React$useState2 = _slicedToArray(_React$useState, 2),\n      activeValue = _React$useState2[0],\n      setActiveValue = _React$useState2[1];\n\n  var _React$useState3 = React.useState(0),\n      _React$useState4 = _slicedToArray(_React$useState3, 2),\n      accessibilityIndex = _React$useState4[0],\n      setAccessibilityIndex = _React$useState4[1];\n\n  var mergedDefaultActiveFirstOption = defaultActiveFirstOption !== undefined ? defaultActiveFirstOption : mode !== 'combobox';\n  var onActiveValue = React.useCallback(function (active, index) {\n    var _ref2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},\n        _ref2$source = _ref2.source,\n        source = _ref2$source === void 0 ? 'keyboard' : _ref2$source;\n\n    setAccessibilityIndex(index);\n\n    if (backfill && mode === 'combobox' && active !== null && source === 'keyboard') {\n      setActiveValue(String(active));\n    }\n  }, [backfill, mode]); // ========================= OptionList =========================\n\n  var triggerSelect = function triggerSelect(val, selected, type) {\n    var getSelectEnt = function getSelectEnt() {\n      var _option$key2;\n\n      var option = getMixedOption(val);\n      return [labelInValue ? {\n        label: option === null || option === void 0 ? void 0 : option[mergedFieldNames.label],\n        value: val,\n        key: (_option$key2 = option === null || option === void 0 ? void 0 : option.key) !== null && _option$key2 !== void 0 ? _option$key2 : val\n      } : val, injectPropsWithOption(option)];\n    };\n\n    if (selected && onSelect) {\n      var _getSelectEnt = getSelectEnt(),\n          _getSelectEnt2 = _slicedToArray(_getSelectEnt, 2),\n          wrappedValue = _getSelectEnt2[0],\n          _option = _getSelectEnt2[1];\n\n      onSelect(wrappedValue, _option);\n    } else if (!selected && onDeselect && type !== 'clear') {\n      var _getSelectEnt3 = getSelectEnt(),\n          _getSelectEnt4 = _slicedToArray(_getSelectEnt3, 2),\n          _wrappedValue = _getSelectEnt4[0],\n          _option2 = _getSelectEnt4[1];\n\n      onDeselect(_wrappedValue, _option2);\n    }\n  }; // Used for OptionList selection\n\n\n  var onInternalSelect = useRefFunc(function (val, info) {\n    var cloneValues; // Single mode always trigger select only with option list\n\n    var mergedSelect = multiple ? info.selected : true;\n\n    if (mergedSelect) {\n      cloneValues = multiple ? [].concat(_toConsumableArray(mergedValues), [val]) : [val];\n    } else {\n      cloneValues = mergedValues.filter(function (v) {\n        return v.value !== val;\n      });\n    }\n\n    triggerChange(cloneValues);\n    triggerSelect(val, mergedSelect); // Clean search value if single or configured\n\n    if (mode === 'combobox') {\n      // setSearchValue(String(val));\n      setActiveValue('');\n    } else if (!isMultiple || autoClearSearchValue) {\n      setSearchValue('');\n      setActiveValue('');\n    }\n  }); // ======================= Display Change =======================\n  // BaseSelect display values change\n\n  var onDisplayValuesChange = function onDisplayValuesChange(nextValues, info) {\n    triggerChange(nextValues);\n    var type = info.type,\n        values = info.values;\n\n    if (type === 'remove' || type === 'clear') {\n      values.forEach(function (item) {\n        triggerSelect(item.value, false, type);\n      });\n    }\n  }; // =========================== Search ===========================\n\n\n  var onInternalSearch = function onInternalSearch(searchText, info) {\n    setSearchValue(searchText);\n    setActiveValue(null); // [Submit] Tag mode should flush input\n\n    if (info.source === 'submit') {\n      var formatted = (searchText || '').trim(); // prevent empty tags from appearing when you click the Enter button\n\n      if (formatted) {\n        var newRawValues = Array.from(new Set([].concat(_toConsumableArray(rawValues), [formatted])));\n        triggerChange(newRawValues);\n        triggerSelect(formatted, true);\n        setSearchValue('');\n      }\n\n      return;\n    }\n\n    if (info.source !== 'blur') {\n      if (mode === 'combobox') {\n        triggerChange(searchText);\n      }\n\n      onSearch === null || onSearch === void 0 ? void 0 : onSearch(searchText);\n    }\n  };\n\n  var onInternalSearchSplit = function onInternalSearchSplit(words) {\n    var patchValues = words;\n\n    if (mode !== 'tags') {\n      patchValues = words.map(function (word) {\n        var opt = labelOptions.get(word);\n        return opt === null || opt === void 0 ? void 0 : opt.value;\n      }).filter(function (val) {\n        return val !== undefined;\n      });\n    }\n\n    var newRawValues = Array.from(new Set([].concat(_toConsumableArray(rawValues), _toConsumableArray(patchValues))));\n    triggerChange(newRawValues);\n    newRawValues.forEach(function (newRawValue) {\n      triggerSelect(newRawValue, true);\n    });\n  }; // ========================== Context ===========================\n\n\n  var selectContext = React.useMemo(function () {\n    var realVirtual = virtual !== false && dropdownMatchSelectWidth !== false;\n    return _objectSpread(_objectSpread({}, parsedOptions), {}, {\n      flattenOptions: displayOptions,\n      onActiveValue: onActiveValue,\n      defaultActiveFirstOption: mergedDefaultActiveFirstOption,\n      onSelect: onInternalSelect,\n      menuItemSelectedIcon: menuItemSelectedIcon,\n      rawValues: rawValues,\n      fieldNames: mergedFieldNames,\n      virtual: realVirtual,\n      listHeight: listHeight,\n      listItemHeight: listItemHeight,\n      childrenAsData: childrenAsData\n    });\n  }, [parsedOptions, displayOptions, onActiveValue, mergedDefaultActiveFirstOption, onInternalSelect, menuItemSelectedIcon, rawValues, mergedFieldNames, virtual, dropdownMatchSelectWidth, listHeight, listItemHeight, childrenAsData]); // ========================== Warning ===========================\n\n  if (process.env.NODE_ENV !== 'production') {\n    warningProps(props);\n    warningNullOptions(mergedOptions, mergedFieldNames);\n  } // ==============================================================\n  // ==                          Render                          ==\n  // ==============================================================\n\n\n  return /*#__PURE__*/React.createElement(SelectContext.Provider, {\n    value: selectContext\n  }, /*#__PURE__*/React.createElement(BaseSelect, _extends({}, restProps, {\n    // >>> MISC\n    id: mergedId,\n    prefixCls: prefixCls,\n    ref: ref,\n    omitDomProps: OMIT_DOM_PROPS,\n    mode: mode // >>> Values\n    ,\n    displayValues: displayValues,\n    onDisplayValuesChange: onDisplayValuesChange // >>> Search\n    ,\n    searchValue: mergedSearchValue,\n    onSearch: onInternalSearch,\n    autoClearSearchValue: autoClearSearchValue,\n    onSearchSplit: onInternalSearchSplit,\n    dropdownMatchSelectWidth: dropdownMatchSelectWidth // >>> OptionList\n    ,\n    OptionList: OptionList,\n    emptyOptions: !displayOptions.length // >>> Accessibility\n    ,\n    activeValue: activeValue,\n    activeDescendantId: \"\".concat(mergedId, \"_list_\").concat(accessibilityIndex)\n  })));\n});\n\nif (process.env.NODE_ENV !== 'production') {\n  Select.displayName = 'Select';\n}\n\nvar TypedSelect = Select;\nTypedSelect.Option = Option;\nTypedSelect.OptGroup = OptGroup;\nexport default TypedSelect;"],"mappings":"AAAA,OAAOA,QAAQ,MAAM,oCAAoC;AACzD,OAAOC,kBAAkB,MAAM,8CAA8C;AAC7E,OAAOC,eAAe,MAAM,2CAA2C;AACvE,OAAOC,aAAa,MAAM,0CAA0C;AACpE,OAAOC,cAAc,MAAM,0CAA0C;AACr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